﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QLDSVCNTT_Nhom1
{
    public static class ShowForm
    {
        public static frmDangNhapHeThong _frmDN = null;
        public static frmDanhSachNguoiDung _frmQLUser = null;
        //public static frmQuanLyLop _frmQLLop = null;
        public static frmQuanLySinhVien _frmQLSV = null;
        public static frmQuanLyMonHoc _frmQLMH = null;
        public static FrmThemPCGD _frmThemPCGD = null;
        public static frmQuanLyPCGD _frmQLPCGD = null;
        public static FrmGiangVien _frmGV = null;
        public static FrmThemGiangVien _frmThemGV = null;
        public static DBBackup _frmBackup = null;
        
        public static frmGVQuanLyMonHoc _frmGVQLMH = null;
        //public static frmGVQuanLyDiem _frmGVQLD = null;
        public static frmQuanLyDangKyHocPhan _frmQLDKHP = null;
        public static frmQuanLyDangKyHocPhan _frmQLDKHPSV = null;


        public static void ShowFormQuanLyDangKyHocPhan_SV(frmMain frm)
        {
            if (_frmQLDKHPSV == null || _frmQLDKHPSV.IsDisposed)
            {
                _frmQLDKHPSV = new frmQuanLyDangKyHocPhan();
                _frmQLDKHPSV.MdiParent = frm;
                _frmQLDKHPSV.QuyenHan = frm.QuyenHan;
                _frmQLDKHPSV.TenDangNhap = frm.TenDangNhap;
                _frmQLDKHPSV.ShowFormForStudent(frm.TenDangNhap);
                _frmQLDKHPSV.Show();
            }
            else
                _frmQLDKHPSV.Activate();
        }
        public static void ShowFormQuanLyDangKyHocPhan(frmMain frm)
        {
            if (_frmQLDKHP == null || _frmQLDKHP.IsDisposed)
            {
                _frmQLDKHP = new frmQuanLyDangKyHocPhan();
                _frmQLDKHP.MdiParent = frm;
                _frmQLDKHP.QuyenHan = frm.QuyenHan;
                _frmQLDKHP.Show();
            }
            else
                _frmQLDKHP.Activate();
        }
        public static void ShowFormDangNhap(frmMain frm)
        {
            if (_frmDN == null || _frmDN.IsDisposed)
            {
                _frmDN = new frmDangNhapHeThong();
                _frmDN.MdiParent = frm;
                _frmDN.Show();
            }
            else
                _frmDN.Activate();
        }
        public static void ShowFormQuanLyUser(frmMain frm)
        {
            if (_frmQLUser == null || _frmQLUser.IsDisposed)
            {
                _frmQLUser = new frmDanhSachNguoiDung();
                _frmQLUser.MdiParent = frm;
                _frmQLUser.Show();
            }
            else
                _frmQLUser.Activate();
        }
        public static void ShowFormQuanLyLop(frmMain frm)
        {
            if (_frmQLLop == null || _frmQLLop.IsDisposed)
            {
                _frmQLLop = new frmQuanLyLop();
                _frmQLLop.MdiParent = frm;
                _frmQLLop.Show();
            }
            else
                _frmQLLop.Activate();
        }
        public static void ShowFormQuanLySinhVien(frmMain frm)
        {
            if (_frmQLSV == null || _frmQLSV.IsDisposed)
            {
                _frmQLSV = new frmQuanLySinhVien();
                _frmQLSV.MdiParent = frm;
                _frmQLSV.Show();
            }
            else
                _frmQLSV.Activate();
        }
        public static void ShowFormQuanLyMonHoc(frmMain frm)
        {
            if (_frmQLMH == null || _frmQLMH.IsDisposed)
            {
                _frmQLMH = new frmQuanLyMonHoc();
                _frmQLMH.MdiParent = frm;
                _frmQLMH.Show();
            }
            else
                _frmQLMH.Activate();
        }
        public static void ShowFormThemPCGD(frmMain frm)
        {
            if (_frmThemPCGD == null || _frmThemPCGD.IsDisposed)
            {
                _frmThemPCGD = new FrmThemPCGD();
                _frmThemPCGD.MdiParent = frm;
                _frmThemPCGD.Show();
            }
            else
                _frmThemPCGD.Activate();
        }
        public static void ShowFormQLPCGD(frmMain frm)
        {
            if (_frmQLPCGD == null || _frmQLPCGD.IsDisposed)
            {
                _frmQLPCGD = new frmQuanLyPCGD();
                _frmQLPCGD.MdiParent = frm;
                _frmQLPCGD.Show();
            }
            else
                _frmQLPCGD.Activate();
        }
        public static void ShowFormGiangVien(frmMain frm)
        {
            if (_frmGV == null || _frmGV.IsDisposed)
            {
                _frmGV = new FrmGiangVien();
                _frmGV.MdiParent = frm;
                _frmGV.Show();
            }
            else
                _frmGV.Activate();
        }
        public static void ShowFormThemGiangVien(frmMain frm)
        {
            if (_frmThemGV == null || _frmThemGV.IsDisposed)
            {
                _frmThemGV = new FrmThemGiangVien();
                _frmThemGV.MdiParent = frm;
                _frmThemGV.Show();
            }
            else
                _frmThemGV.Activate();
        }
        public static void ShowFormBackup_Restore(frmMain frm)
        {
            if (_frmBackup == null || _frmBackup.IsDisposed)
            {
                _frmBackup = new DBBackup();
                _frmBackup.MdiParent = frm;
                _frmBackup.Show();
            }
            else
                _frmBackup.Activate();
        }
        
        public static void ShowFormGVQLMH(frmMain frm)
        {
            if (_frmGVQLMH == null || _frmGVQLMH.IsDisposed)
            {
                _frmGVQLMH = new frmGVQuanLyMonHoc();
                _frmGVQLMH.MdiParent = frm;
                _frmGVQLMH.Show();
            }
            else
                _frmGVQLMH.Activate();
        }
        //public static void ShowFormGVQLD(frmMain frm)
        //{
        //    if (_frmGVQLD == null || _frmGVQLD.IsDisposed)
        //    {
        //        _frmGVQLD = new frmGVQuanLyDiem();
        //        _frmGVQLD.MdiParent = frm;
        //        _frmGVQLD.Show();
        //    }
        //    else
        //        _frmGVQLD.Activate();
        //}
    }
}
